#include <iostream>
#include "util.hpp"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <cstring>

void test1()
{
    ckflogs::util::Date date;
    date.get();
    printf("%d-%d-%d %d:%d:%d\n", date.year, date.month, date.day, date.hour, date.min, date.sec);
}

void test2()
{
    // int n = open("abc/bcd.txt", O_CREAT);

    // if (n < 0)
    // {
    //     std::cout << "errno: " << errno << std::endl;
    //     std::cout << "strerror: " << strerror(errno) << std::endl;
    // }

    // bool f = ckflogs::util::File::createDirctory("./abc/def/ghi/");
    bool f = ckflogs::util::File::createDirctory("abc/def/ghi");

    if (f)
        std::cout << "创建成功" << std::endl;
    else
        std::cout << "创建失败" << std::endl;
}

int main()
{
    // test1();
    test2();
    return 0;
}